using System;

namespace Nyanimals
{
    public class CEventListener
    {
        public delegate void HandleEvent(CBaseObject obj, CBaseEvent e);
        
        private CBaseObject owner;        
        private HandleEvent EventFunction;
        
        
        public CBaseObject Owner
        {
            get { return owner;}
        }
        public HandleEvent EventFunc
        {
            get { return EventFunction;}
        }
        
        public CEventListener(CBaseObject obj, HandleEvent func)
        {
            owner = obj;
            EventFunction = func;
        }  
        
        public void ProcessEvent(CBaseEvent e)
        {
            EventFunction(owner, e);
        }
        
    }
}

